/**
 * Created by ZFL on 2017/9/21.
 */
var vm=new Vue({
    el:'#payDetail',
    data:{
        orderDetail:[],    //订单详情
        storeName:'',     //店铺名称
        totalPrice:'',    //消费金额
        totalFee:'',     //实付金额
        updateTime:'',    //买单时间
        takeCode:'',    //订单编码

    }
})
Vue.filter('price',function(value){
    return divideNumber(value,100);
})
function appInit(){
    PageInit();
}
function PageInit(){

    payDetail();
}
function payDetail(){
    $.ajaxHandler({
        model:function(){
            var obj={};
            obj.userId= $.getPara('userId');
            obj.orderPayId= $.getPara('orderPayId')
            return obj;
        },
        visibleTime: 0,
        dataType: "json",
        visible:'hide',
        api: 'yg_baijiaapporder/orderPay/selectByUserId',
        success:function(result){
            if(result.code===10000){
                var data=result.data;
                vm.storeName=data.storeName;
                vm.totalPrice=data.totalPrice;
                vm.totalFee=data.totalFee;
                vm.updateTime=data.updateTime;
                vm.takeCode=data.takeCode;
                var qrcode=new QRCode(document.getElementById("qrcode"),{
                    text:vm.takeCode,
                    width: 150,
                    height: 150,
                    colorDark : "#000000",
                    colorLight : "#ffffff",
                    correctLevel : QRCode.CorrectLevel.H

                })
            }
        }
    })
}